#!/usr/bin/perl

open fd, "ps -aux | grep TimePrintfClient |" or die "cannot open\n";
#open fd, "ps -aux | grep PrintfClient |" or die "cannot open\n";

while (<fd>) {
  chomp;
  @ret = split;
  #print "$ret[1], ";

  $cmd = "";
  for ($i=10; $i<@ret; $i++) {
    $cmd = $cmd . " " . $ret[$i];
  }
  #print "$cmd\n";

  #if ($cmd =~ /ListenLog/) {
  if ($cmd =~ /TimePrintfClient/) {
  #if ($cmd =~ /PrintfClient/) {
    $cmd2 = "kill $ret[1]";
    print "$cmd2\n";
    system("$cmd2");
  }
}

close fd;

